<?php
class model extends ModelAbstract
{
	public function getRight()
	{
		$key = (isset($_POST['key'])? trim($_POST['key']) : '');
		if(isset($_SESSION['user']) && $_SESSION['user'] == 'Brximl'){
			echo '<script> window.location.href="file.php";</script>';
			exit;
		}
		if($key == SITE_KEY)
		{
			w_logined($this);
			/*
			//数据累计出错	
			$_SESSION['user'] = 'Brximl';
			//header('Loaction:guest.php;');
			if($file = virtualDb('data','vtimes.data'))
			{
				if($handle = fopen($file,'r+'))
				{
					$vtimes = fgets($handle);
					$vtimeData = json_decode($vtimes,true);
					$vtimeData["V"] += 1;
					$vtimeStr = json_encode($vtimeData);
					fseek($handle,0);
					fwrite($handle,$vtimeStr);
					fclose($handle);
					$_SESSION['vtimes'] = $vtimeStr;//采用session 存取 json字符串数据
					$wriStr = "\r\n登入时间：".date("Y-m-d H:i:s")."。第".$vtimeData["V"]."次登入系统。IP地址：".getIp()."。";
					$this->console($wriStr,'N','vtimes.log');
				}
			}
			*/
			echo '<script> window.location.href="file.php";</script>';
			exit;
		}
		//header('Loaction:guest.php');//?无效
		unset($_SESSION['user']);
		echo '<script> window.location.href="guest.php";</script>';
		echo 'dfkl';
	}
	public function register()
	{
		print_r($_POST);
	}
}
?>